<template>
  <div class="d1" style="margin: 0px;padding: 0px">
    <el-header style="width: 100%">
      <nav-bar style="color: black"></nav-bar>
      <div class="banner">
        <img src="../assets/img/a6ce035508a48ec9448266bf28ac9d0.png" alt="" style="width: 100%" class="img1"/>
      </div>
    </el-header>
    <div class="d2">
      <el-container>
        <el-header class="e1">
          <!--          头部-->
          <div class="ee1">
            个人信息
          </div>
          <div class="ee2">
            {{ usernickname }}欢迎您来到主页
          </div>
        </el-header>
        <el-container>
          <el-aside style="width: 160px">
            <el-row class="tac">
              <el-col :span="12">
                <!--                <h5>默认颜色</h5>-->
                <el-menu
                    style="width: 150px"
                    default-active="2"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose">
                  <router-link to="/shou" style="text-decoration: none">
                    <el-menu-item index='2'>
                      <i class="el-icon-menu"></i>
                      <span slot="title">首页</span>
                    </el-menu-item>
                  </router-link>
                  <router-link to="/head" style="text-decoration: none">
                    <el-menu-item index="3">
                      <i class="el-icon-menu"></i>我的头像
                    </el-menu-item>
                  </router-link>
                  <router-link to="/mes" style="text-decoration: none">
                    <el-menu-item index="4">
                      <i class="el-icon-menu"></i>我的信息
                    </el-menu-item>
                    <!--                    <span slot="title">我的信息</span>-->
                  </router-link>
                  <!--                    <span slot="title">账号安全</span>-->
                  <router-link to="/passwd" style="text-decoration: none">
                    <el-menu-item index="5">
                      <i class="el-icon-menu"></i>账号安全
                    </el-menu-item>
                  </router-link>
                </el-menu>
              </el-col>
            </el-row>
          </el-aside>
          <el-main style="">
            <router-view/>
          </el-main>
        </el-container>
      </el-container>
    </div>
  </div>
</template>

<script>

export default {
  name: "personage",
  data() {
    return {
      arr: {
        a: 1,
        b: 2,
        c: 3,
        d: 4
      },
      flag: 0,
      //用户昵称
      usernickname: '',
    }
  }, created() {
    var user = JSON.parse(sessionStorage.getItem('user'));
    if (user) {
      this.usernickname = user.userNickname;
    } else {
      this.$router.push("/home")
    }

  }, methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style scoped>
.banner {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: 100%;
  height: 9.5vw;
  min-height: 155px;
  overflow: hidden;
}

.banner img {
  height: 80%;
  width: 100%;
}

.d1 {
  position: relative;
  text-align: center;
}

.d2 {
  margin: 50px auto;
  width: 1000px;
  height: 550px;
  border: 1px solid darkgray;
  box-shadow: 3px 3px 10px gray;
  border-radius: 10px;
}

.img1 {
  height: 100px;
  width: 1200px;
}

.e1 {
  /*border: 2px solid red;*/
  position: relative;
}

.ee1 {
  float: left;
  margin-left: -20px;
  height: 55px;
  width: 150px;
  text-align: center;
  font-weight: bold;
  line-height: 55px;
  display: inline-block;
  border-right: 1px solid darkgray;
  border-bottom: 1px solid darkgray;
}

.ee2 {
  float: left;
  display: inline-block;
  height: 55px;
  width: 700px;
  text-align: center;
  font-weight: bold;
  line-height: 55px;
  border-bottom: 1px solid darkgray;
}

.tac {
  margin: 0px;
  padding: 0px;
}
</style>
